using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._SpatialAnalystTools._Extraction
{
    /// <summary>
    /// <para>Extract by Mask</para>
    /// <para>Extracts the cells of a raster that correspond to the areas defined by a mask.</para>
    /// <para>提取栅格中与蒙版定义的区域相对应的像元。</para>
    /// </summary>    
    [DisplayName("Extract by Mask")]
    public class ExtractByMask : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public ExtractByMask()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_raster">
        /// <para>Input raster</para>
        /// <para>The input raster from which cells will be extracted.</para>
        /// <para>将从中提取像元的输入栅格。</para>
        /// </param>
        /// <param name="_in_mask_data">
        /// <para>Input raster or feature mask data</para>
        /// <para><xdoc>
        ///   <para>Input mask data defining areas to extract.</para>
        ///   <para>It can be a raster or feature dataset.</para>
        ///   <para>When the input mask data is a raster, NoData cells on the mask will be assigned NoData values on the output raster.</para>
        ///   <para>When the input mask is feature data, cells in the input raster whose center falls within the perimeter of the feature will be included in the output, while cells whose center falls outside it will receive NoData.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输入掩码数据，定义要提取的区域。</para>
        ///   <para>它可以是栅格数据集或要素数据集。</para>
        ///   <para>当输入掩膜数据为栅格时，将在输出栅格上为掩膜上的 NoData 像元分配 NoData 值。</para>
        ///   <para>当输入掩码为要素数据时，输入栅格中中心位于要素周长内的像元将包含在输出中，而中心位于要素周外的像元将接收 NoData。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_out_raster">
        /// <para>Output raster</para>
        /// <para>The output raster containing the cell values extracted from the input raster.</para>
        /// <para>包含从输入栅格中提取的像元值的输出栅格。</para>
        /// </param>
        public ExtractByMask(object _in_raster, object _in_mask_data, object _out_raster)
        {
            this._in_raster = _in_raster;
            this._in_mask_data = _in_mask_data;
            this._out_raster = _out_raster;
        }
        public override string ToolboxName => "Spatial Analyst Tools";

        public override string ToolName => "Extract by Mask";

        public override string CallName => "sa.ExtractByMask";

        public override List<string> AcceptEnvironments => ["autoCommit", "cellSize", "cellSizeProjectionMethod", "compression", "configKeyword", "extent", "geographicTransformations", "mask", "outputCoordinateSystem", "scratchWorkspace", "snapRaster", "tileSize", "workspace"];

        public override object[] ParameterInfo => [_in_raster, _in_mask_data, _out_raster];

        /// <summary>
        /// <para>Input raster</para>
        /// <para>The input raster from which cells will be extracted.</para>
        /// <para>将从中提取像元的输入栅格。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_raster { get; set; }


        /// <summary>
        /// <para>Input raster or feature mask data</para>
        /// <para><xdoc>
        ///   <para>Input mask data defining areas to extract.</para>
        ///   <para>It can be a raster or feature dataset.</para>
        ///   <para>When the input mask data is a raster, NoData cells on the mask will be assigned NoData values on the output raster.</para>
        ///   <para>When the input mask is feature data, cells in the input raster whose center falls within the perimeter of the feature will be included in the output, while cells whose center falls outside it will receive NoData.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输入掩码数据，定义要提取的区域。</para>
        ///   <para>它可以是栅格数据集或要素数据集。</para>
        ///   <para>当输入掩膜数据为栅格时，将在输出栅格上为掩膜上的 NoData 像元分配 NoData 值。</para>
        ///   <para>当输入掩码为要素数据时，输入栅格中中心位于要素周长内的像元将包含在输出中，而中心位于要素周外的像元将接收 NoData。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input raster or feature mask data")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_mask_data { get; set; }


        /// <summary>
        /// <para>Output raster</para>
        /// <para>The output raster containing the cell values extracted from the input raster.</para>
        /// <para>包含从输入栅格中提取的像元值的输出栅格。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_raster { get; set; }


        public ExtractByMask SetEnv(int? autoCommit = null, object cellSize = null, object compression = null, object configKeyword = null, object extent = null, object geographicTransformations = null, object mask = null, object outputCoordinateSystem = null, object scratchWorkspace = null, object snapRaster = null, double[] tileSize = null, object workspace = null)
        {
            base.SetEnv(autoCommit: autoCommit, cellSize: cellSize, compression: compression, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, mask: mask, outputCoordinateSystem: outputCoordinateSystem, scratchWorkspace: scratchWorkspace, snapRaster: snapRaster, tileSize: tileSize, workspace: workspace);
            return this;
        }

    }

}